package com.topscomm.mis.cbb.pm.util;

import com.topscomm.pub.util.SpringUtil;

public class ServiceNameUtil {
    public static String getNameBySourceType(String sourceType) {
        StringBuilder sb = new StringBuilder();
        //如果sourceType表名带下划线
        if (sourceType.contains("_")) {
            // 获取service
            String[] words = sourceType.toLowerCase().split("_");
            for (String word : words) {
                sb.append(Character.toUpperCase(word.charAt(0))).append(word.substring(1));
            }
        }
        sb.append("Service");
        String output = sb.toString();
        return output.replaceFirst("^\\w", output.substring(0, 1).toLowerCase());
    }
}
